<div class="mui-scrollbar mui-scrollbar-vertical">
    <div class="mui-scrollbar-indicator" style="transition-duration: 0ms; display: none; height: 882px; transform: translate3d(0px, 0px, 0px) translateZ(0px);"></div>
</div>
</div>
<script src="/static/home/mui.min.js" type="text/javascript" charset="utf-8"></script>
<script src="/static/home/mui.showLoading.js" type="text/javascript" charset="utf-8"></script>
<script src="/static/home/style.js" type="text/javascript" charset="utf-8"></script>
<script src="/static/home/layui.js"></script>
<script>
    var mask=mui.createMask();
    layui.use('upload', function(){
        var upload = layui.upload;
        upload.render({
            elem: '.uploadImg',
            url:'/Zfuwl/Api/imageUp.html',
            choose:function(){
                mui.showLoading("提交中","div");
                mask.show();//显示遮罩层
            },
            before: function(obj){
                mui.showLoading("上传中","div");
                obj.preview(function(index, file, result){
                    $('.uploadImgHead').find('img').attr('src', result);
                });
            }
            ,done: function(res, index, upload){
                $.post("/User/saveUserHeadImg.html",{src:res.data.src}, function(data){
                    mask.close();//关闭遮罩层
                    mui.hideLoading();
                    if(data.status == 1) {
                        mui.toast('上传成功',{ duration:'2000', type:'div' });
                    } else {
                        mui.toast(data.msg,{ duration:'2000', type:'div' });
                    }
                });
            },error:function(){
                mask.close();//关闭遮罩层
                mui.hideLoading();
                mui.toast('上传失败',{ duration:'2000', type:'div' });
            }
        });
    });
    mui('body').on('tap', '.uploadImgHead', function(){
        $('.uploadImg').click();
    });

    mui('body').on('tap', ".logout", function () {
        var btnArray = ['確認', '取消'];
        mui.confirm('是否確認退出？', '溫馨提示', btnArray, function (e) {
            if (e.index == 0) {
                $.post("{:url('Login/logout')}");
                mui.openWindow({
                    id: 'logout',
                    url: host+"{:url('Login/dologin')}"
                });
            }
        });
    });
</script>